import * as base from "./src/base"
import * as castTo from "./src/castTo"
import * as define from "./src/define"
import * as module_ from "./src/module"
import * as object from "./src/object"
import * as arithmetic_peration from "./src/arithmetic_peration"
import * as logical_operation from "./src/logical_operation"
import built_in_object from "./src/built_in_object"
import { Main } from "./src/Main"


export const plugin: pluginOptions = {
    name: "javascript",
    modules: [
        {
            groupName: "变量类型定义",
            expand: true, // 默认是否展开
            nodes: define
        },
        
        {
            groupName: "类型转换",
            expand: true,
            nodes: castTo
        },
        {
            groupName:"算数运算",
            expand: true,
            nodes: arithmetic_peration
        },
        {
            groupName: "逻辑运算",
            expand: true,
            nodes: logical_operation
        },
        {
            groupName: "流程控制",
            expand: true,
            nodes: {
                Main,
                ...base,
                ...module_,
                ...object,
            }
        },
        {
            groupName: "内置对象",
            expand: true,
            nodes: built_in_object
        },
    ],
    
    // 节点创建之前
    onNodeCreateBefore(obj:any){
        // console.log(obj)
        return 0
    },

    // 节点创建之后
    onNodeCreateAfter(){
        
    },

    // 菜单创建
    onMenuCreated(){
        return 0
    }
}